package com.sq.system.entry;

import com.sq.common.entry.TreeSelect;
import com.sq.system.pojo.SysDept;
import lombok.Data;

import java.util.stream.Collectors;

/**
 * @Author Li sir
 * @Date 2024/10/28
 */
@Data
public class DeptTreeSelect extends TreeSelect {

    public DeptTreeSelect(SysDept dept)
    {
        this.setId(dept.getDeptId());
        this.setLabel(dept.getDeptName());
        this.setChildren(dept.getChildren().stream().map(DeptTreeSelect::new).collect(Collectors.toList()));
    }

}
